package com.yanshibo.house01_service.service.impl;



import java.util.List;

import javax.validation.Valid;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yanshibo.house01_bean.bean.Hourse;
import com.yanshibo.house01_bean.bean.Lei;
import com.yanshibo.house01_bean.bean.PeiTao;
import com.yanshibo.house01_bean.bean.Tem;
import com.yanshibo.house01_dao.dao.MyDao;
import com.yanshibo.house01_service.service.MyService;

//业务逻辑层实现类
@Service
public class MyServiceImp implements MyService{

	@Autowired
	private MyDao dao;

	
	//列表
	@Override
	public PageInfo<Hourse> list(Integer pageNum, Integer pageSize, Tem tem) {
		// TODO Auto-generated method stub
		PageHelper.startPage(pageNum, pageSize);
		List<Hourse> list = dao.list(tem);
		PageInfo<Hourse> info = new PageInfo<Hourse>(list);
		return info;
	}


	//出租
	@Override
	public void chu(String id) {
		// TODO Auto-generated method stub
		dao.chu(id);
	}


	//退租
	@Override
	public void tui(String id) {
		// TODO Auto-generated method stub
		dao.tui(id);
	}


	// 删除
	@Override
	public void del(String id) {
		// TODO Auto-generated method stub
		dao.del(id);
	}


	//房屋类型
	@Override
	public List<Lei> listLei() {
		// TODO Auto-generated method stub
		return dao.listLei();
	}


	
	//添加房屋信息
	@Override
	public void addHou(@Valid Hourse hou) {
		// TODO Auto-generated method stub
		dao.addHou(hou);
		
	}

	//查询房屋信息
	@Override
	public Hourse listHou(Integer id) {
		// TODO Auto-generated method stub
		return dao.listHou(id);
	}


	//添加配套设施
	@Override
	public void addPei(@Valid PeiTao pei) {
		// TODO Auto-generated method stub
		dao.addPei(pei);
	}


	//查询配套设施
	@Override
	public PeiTao seletePei(@Valid PeiTao pei) {
		// TODO Auto-generated method stub
		return dao.seletePei(pei);
	}


}
